<script setup lang="ts">
  import { ref } from 'vue';

  let name = ref('admin');
  let age = ref(18);
  let gender = ref('男');

  function add(){
    age.value++;  // 注意是value!!
  }
  function change(){
    if(gender.value=='男'){
        gender.value='女'
    }else{
        gender.value='男'
    }
  }
</script>
<template>
    <div class="home">
        <h2>姓名:{{name}}</h2>
        <h2>年龄:{{age}}</h2>
        <h2>性别:{{gender}}</h2>
        <button @click="add">年龄+1</button>
        <button @click="change">改变性别</button>
    </div>
</template>
<style>

</style>